package com.chuanjiabao.wisdom.util.dialog;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.view.LayoutInflater;
import android.view.View;

import com.chuanjiabao.wisdom.R;
import com.chuanjiabao.wisdom.databinding.DialogTopZhidaBinding;
import com.chuanjiabao.wisdom.listener.OnPositionClickListener;
import com.flyco.animation.SlideEnter.SlideTopEnter;
import com.flyco.animation.SlideExit.SlideTopExit;
import com.flyco.dialog.widget.base.TopBaseDialog;

public class ArriveDialog extends TopBaseDialog {

    Context context;
    DialogTopZhidaBinding binding;
    OnPositionClickListener onListener;

    public ArriveDialog(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    public View onCreateView() {
        binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_top_zhida,
                null,false);
        binding.setDialog(this);
        return binding.getRoot();
    }

    @Override
    public void setUiBeforShow() {
        showAnim(new SlideTopEnter());
        dismissAnim(new SlideTopExit());
    }

    public void setOnBHClickListener(OnPositionClickListener onBHClickListener) {
        this.onListener = onBHClickListener;
    }

    public void onClose(View view){
        dismiss();
    }

    public void onHome(View view){
        if (onListener != null) {
            onListener.setOnPositionClickListener(1);
        }
        dismiss();
    }

    public void onSecret(View view){
        if (onListener != null) {
            onListener.setOnPositionClickListener(2);
        }
        dismiss();
    }

    public void onSetting(View view){
        if (onListener != null) {
            onListener.setOnPositionClickListener(3);
        }
        dismiss();
    }

}

